package com.example.myworkers.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.myworkers.dao.EmpOutworkMapper;
import com.example.myworkers.model.EmpOutwork;
import com.example.myworkers.service.EmpOutworkService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 吴秋霞
 * @description 针对表【emp_outwork】的数据库操作Service实现
 * @createDate 2023-10-29 17:34:37
 */
@Service
public class EmpOutworkServiceImpl extends ServiceImpl<EmpOutworkMapper, EmpOutwork>
        implements EmpOutworkService {

    @Override
    public List<EmpOutwork> getEmpOutworkList(EmpOutwork empOutwork) {
        LambdaQueryWrapper<EmpOutwork> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(empOutwork.getEmpname() != null,EmpOutwork::getEmpname,empOutwork.getEmpname())
                .eq(StringUtils.isNotBlank(empOutwork.getOutworkstarttime()),EmpOutwork::getOutworkstarttime,empOutwork.getOutworkstarttime());

        List<EmpOutwork> list = list(queryWrapper);
        return list;
    }
}

